package net.oschina.app.fragment;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.GridView;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import net.oschina.app.R;
import net.oschina.app.bean.PraiseBean;
import net.oschina.app.util.CommonUtils;

import butterknife.BindView;
import butterknife.ButterKnife;
import de.hdodenhof.circleimageview.CircleImageView;

/**
 * Created by elf on 2017/1/18.
 */
public class DetailPraiseFragment extends Fragment {
    @BindView(R.id.iv_icont)
    CircleImageView mIvIcont;
    @BindView(R.id.tv_name)
    TextView mTvName;
    @BindView(R.id.tv_time)
    TextView mTvTime;
    @BindView(R.id.tv_des1)
    TextView mTvDes1;
    @BindView(R.id.tv_praisecount1)
    TextView mTvPraisecount1;
    @BindView(R.id.tv_commentcount1)
    TextView mTvCommentcount1;
    @BindView(R.id.tv_des2)
    TextView mTvDes2;
    @BindView(R.id.ll_likelist)
    LinearLayout mLlLikelist;
    @BindView(R.id.et_comment)
    EditText mEtComment;
    @BindView(R.id.iv_emoji)
    ImageView mIvEmoji;
    @BindView(R.id.iv_send)
    ImageView mIvSend;
    @BindView(R.id.gv_emoji)
    GridView mGvEmoji;
    @BindView(R.id.tv_goods_name)
    TextView mTvGoodsName;
    private PraiseBean.MytweetBean mMytweetBean;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
                             @Nullable Bundle savedInstanceState) {
        View itemView = LayoutInflater.from(CommonUtils.getContext()).inflate(R.layout.tweet_detail, container, false);
        ButterKnife.bind(this, itemView);
        Bundle arguments = getArguments();
        mMytweetBean = (PraiseBean.MytweetBean) arguments.get("mytweetBean");
        initData();
        return itemView;
    }

    private void initData() {
        mTvName.setText(mMytweetBean.getTweet().getAuthor());
        mTvTime.setText(mMytweetBean.getDatatime());
        mTvDes1.setText(mMytweetBean.getTweet().getBody());
        mTvGoodsName.setText(mMytweetBean.getUser().getName()+"觉得很赞");
        mTvPraisecount1.setText("1");
    }
}
